import request from '@/config/axios'

export interface CrmStatisticsClueSummaryByDateRespVO {
  time: string
  clueCreateCount: number
  clueTransCount: number
}

export interface CrmStatisticsClueSummaryByUserRespVO {
  ownerUserName: string
  clueCreateCount: number
  clueTransCount: number
  contractPrice: number
  receivablePrice: number
}

export interface CrmStatisticsFollowUpSummaryByDateRespVO {
  time: string
  followUpRecordCount: number
  followUpClueCount: number
}

export interface CrmStatisticsFollowUpSummaryByUserRespVO {
  ownerUserName: string
  followupRecordCount: number
  followupClueCount: number
}

export interface CrmStatisticsFollowUpSummaryByTypeRespVO {
  followUpType: string
  followUpRecordCount: number
}

export interface CrmStatisticsClueContractSummaryRespVO {
  clueName: string
  contractName: string
  totalPrice: number
  receivablePrice: number
  clueType: string
  clueSource: string
  ownerUserName: string
  creatorUserName: string
  createTime: Date
  orderDate: Date
}

export interface CrmStatisticsPoolSummaryByDateRespVO {
  time: string
  cluePutCount: number
  clueTakeCount: number
}

export interface CrmStatisticsPoolSummaryByUserRespVO {
  ownerUserName: string
  cluePutCount: number
  clueTakeCount: number
}

export interface CrmStatisticsClueDealCycleByDateRespVO {
  time: string
  clueDealCycle: number
}

export interface CrmStatisticsClueDealCycleByUserRespVO {
  ownerUserName: string
  clueDealCycle: number
  clueTransCount: number
}

export interface CrmStatisticsClueDealCycleByAreaRespVO {
  areaName: string
  clueDealCycle: number
  clueTransCount: number
}

export interface CrmStatisticsClueDealCycleByProductRespVO {
  productName: string
  clueDealCycle: number
  clueTransCount: number
}

// 线索分析 API
export const StatisticsClueApi = {
  // 1.1 线索总量分析(按日期)
  getClueSummaryByDate: (params: any) => {
    return request.get({
      url: '/crm/statistics-clue/get-clue-summary-by-date',
      params
    })
  },
  // 1.2 线索总量分析(按用户)
  getClueSummaryByUser: (params: any) => {
    return request.get({
      url: '/crm/statistics-clue/get-clue-summary-by-user',
      params
    })
  },
  // 2.1 线索跟进次数分析(按日期)
  getFollowUpSummaryByDate: (params: any) => {
    return request.get({
      url: '/crm/statistics-clue/get-follow-up-summary-by-date',
      params
    })
  },
  // 2.2 线索跟进次数分析(按用户)
  getFollowUpSummaryByUser: (params: any) => {
    return request.get({
      url: '/crm/statistics-clue/get-follow-up-summary-by-user',
      params
    })
  },
  // 5.1 获取线索公海分析(按日期)
  getPoolSummaryByDate: (param: any) => {
    return request.get({
      url: '/crm/statistics-clue/get-pool-summary-by-date',
      params: param
    })
  },
  // 5.2 获取线索公海分析(按用户)
  getPoolSummaryByUser: (param: any) => {
    return request.get({
      url: '/crm/statistics-clue/get-pool-summary-by-user',
      params: param
    })
  },
  
}
